package com.itheima.xc;

import java.util.Random;

public class Testend {
    public static void main(String[] args) {
        Random random = new Random();
        int[] ints = new int[6];
        System.out.println("数组中的数据为:");
        for (int i = 0; i < ints.length; i++) {
            ints[i]=random.nextInt(10)+1;
            System.out.print(ints[i]+" ");
            System.out.println();
        }
        int max=ints[0],min=ints[0],sum=0;
        for (int i = 1; i < ints.length; i++) {
            if (max<ints[i]){
                max=ints[i];
            }
            if (min>ints[i]){
                min=ints[i];
            }
            sum+=ints[i];
        }
        System.out.println("最大值为:"+max);
        System.out.println("最小值为:"+min);
        System.out.println("平均数为:"+sum);

    }
}
